Methods, systems, and computer program products for adaptively provisioning a sequence in a clustered database environment

ABSTRACT

Described are improved systems, computer program products, and methods for adaptively provisioning an ordered sequence in a clustered database environment. The approach includes identifying a cached list of sequence numbers. A request for one or more sequence numbers in a database environment may be received. A determination may be made to decide whether the request pertains to an ordered sequence. The one or more sequence numbers may be adaptively provisioned to fulfill the request based at least in part upon an independent cache implementation or upon a shared cache implementation.

CROSS REFERENCE TO RELATED APPLICATION(S)

This disclosure is related to U.S. patent application Ser. No. ______entitled “METHODS, SYSTEMS, AND COMPUTER PROGRAM PRODUCTS FOREFFICIENTLY ACCESSING AN ORDERED SEQUENCE IN A CLUSTERED DATABASEENVIRONMENT”, Attorney Docket Number ORC2133672-US-NPR, which is filedconcurrently herewith. The content of the aforementioned U.S. patentapplication is hereby explicitly incorporated by reference for allpurposes.

FIELD

This disclosure concerns a method, a computer program product, and acomputer system for adaptively provisioning ordered and unorderedsequence numbers for application cluster(s) in a database environment.

BACKGROUND

A relational database management system (RDBMS) controls the storage,organization, and retrieval of data stored in relational databaseslocated at one or more database servers. The database server(s) may beinterconnected by a network, which may also connect to one or moreclients (e.g., workstations, personal computers, or remote computingterminals). Clients may submit SQL statements via the network to performvarious tasks in a relational database. There are different types of SQLstatements to perform the various tasks in the relational database. Forexample, clients may manage database objects such as tables, views, etc.using data definition language (DDL) statements (e.g., create schemaobjects, alter schema objects, drop schema objects, grant and revokeprivileges, etc. that result in data dictionary property change(s). Asanother example, clients may access data stored in the database schemaobjects (e.g., tables, views, etc.) using SQL query statements (e.g.,SELECT SQL statements).

Database sequences are designed to give out a sequential range of valuesin a performant way. Sequence objects may be used by customers in avariety of ways—to generate automatic primary keys for table columns,for application specific unique identifiers, and to enforce orderingacross identifiers, to name a few. Ordered sequences allow orderingwithout gaps and are useful for applications such as reservationsystems. For example, one use case for sequences is to generateautomatic primary keys for a table column. An “ordered” sequenceenforces a strict ordering on the sequence values (or sequence numbers)returned.

When an ordered sequence is accessed in parallel from several entities(e.g., multiple sessions of an instance), the serialization required forordering becomes a performance bottleneck. This bottleneck is furtherexacerbated in a multi-instance environment—the sequence may be advancedfrom several sessions across multiple instances and synchronizationacross instances is inherently more expensive.

To use sequencing in a database, the clients of the database systems mayneed to implement ordering with sequences in a manner where they have tosynchronize at a higher level with an application-level lock. Forexample, some approaches first require clients to use unordered sequencenumbers and then introduce a higher-level of synchronization (e.g.,application-level synchronization) to enforce ordering among thesequence numbers that are used. These requirements of ordered sequencesand synchronization with an application-level lock scales poorly andcause a significant slowdown, even with a fairly large sequence cachesize. This poor scalability is one of the reasons that ordered sequencesare often poorly supported (e.g., with significant slowdowns) or notsupported at all by many databases. Therefore, only some databasesprovide support for ordered sequences, albeit with the reducedperformance on these databases being a known issue.

Therefore, some legacy approaches only support unordered sequences.However, users who would like to obtain ordered sequences for theirworkloads may then need to use an unordered sequence and then introducea higher level of synchronization to enforce ordering, usually at theapplication level. Some approaches may further exhibit significantslowdowns in performance of database systems, especially in a clustereddatabase environment. Some of these approaches address such slowdowns byincreasing the sequence cache size so as to reduce the total cost toretrieve sequence numbers from disk. Although these approaches mayimprove the performance of the database systems, such improvement isoften barely satisfactory to users. Moreover, since data and/or metadatafor these larger sequence cache sizes are typically maintained in memoryfor performance reasons, the users of these approaches also run a higherrisk of losing greater amounts of productivity if a failure occursbecause more results, work product, and/or larger sets of sequencenumbers may be lost due to the loss of the node having the largersequence cache size.

On the other hand, decreasing the sequence cache size will mitigate therisk of lost productivity in the event of a system failure because fewersequence numbers and hence less work have been processed due to thesmaller sequence cache size. Nonetheless, decreasing a sequence cachesize requires more frequent access to new sequence numbers from disk andthus further slows down database systems and incur greater system costs.

Therefore, what is needed is a technique or techniques to address atleast the aforementioned shortcomings of conventional approaches andalso to improve over various conventional approaches. Some of theapproaches described in this background section are approaches thatcould be pursued, but not necessarily approaches that have beenpreviously conceived or pursued. Therefore, unless otherwise indicated,it should not be assumed that any of the approaches described in thissection qualify as prior art merely by virtue of their inclusion in thissection.

SUMMARY

According to some embodiments, described are improved systems, computerprogram products, and methods for adaptively provisioning sequencevalues in a database environment, e.g., a clustered databaseenvironment. The present embodiments provide a technique or techniquesto address at least the aforementioned shortcomings of alternativeapproaches and also to improve over various alternative approaches. Thepresent disclosure embeds synchronization into the lowest level withinthe database making it much more performant. The present disclosureemploys a mechanism to reduce the contention seen with ordered sequenceson a single instance as well as across instances. The mechanism may becompletely transparent to the end user and will not require any userintervention.

According to some embodiments, the present disclosure includesidentification of a cached list of sequence numbers. A request for oneor more sequence numbers in a database environment may be received. Adetermination may be made to decide whether the request pertains to asequence. The amount of sequence numbers to provision may be adaptivelydetermined to fulfill the request, e.g., based at least in part upon aprevious consumption rate. The adaptive provisioning of the sequencenumbers may be employed with respect to an independent cacheimplementation or a shared cache implementation.

Various embodiments described herein provide an improved approach toadaptively provision ordered and/or unordered sequence numbers in anydatabase environment, particularly in a clustered database environmentwhere multiple entities (e.g., sessions, instances, computing nodes,etc.) respectively request sequence numbers.

Further details of aspects, objects and advantages of the disclosure aredescribed below in the detailed description, drawings and claims. Boththe foregoing general description and the following detailed descriptionare exemplary and explanatory, and are not intended to be limiting as tothe scope of the disclosure.

BRIEF DESCRIPTION OF FIGURES

The drawings illustrate the design and utility of some embodiments ofthe present disclosure. It should be noted that the figures are notdrawn to scale and that elements of similar structures or functions arerepresented by like reference numerals throughout the figures. In orderto better appreciate how to obtain the above-recited and otheradvantages and objects of various embodiments of the disclosure, a moredetailed description of the present disclosure briefly described abovewill be rendered by reference to specific embodiments thereof, which areillustrated in the accompanying drawings. Understanding that thesedrawings depict only typical embodiments of the disclosure and are nottherefore to be considered limiting of its scope.

The drawings use like reference numerals to identify like elements. Aletter after a reference numeral, such as “120 a,” indicates that thetext refers specifically to the element having that particular referencenumeral. A reference numeral in the text without a following letter,such as “120,” refers to any or all of the elements in the drawingsbearing that reference numeral (e.g., “120” in the text refers toreference numerals “120 a” and/or “120 b” in the drawings). Thedisclosure will be described and explained with additional specificityand detail through the use of the accompanying drawings in which:

FIG. 1 illustrates a schematic diagram of a system for adaptivelyprovisioning sequence numbers in a clustered database environment.

FIG. 2 illustrates a high-level block diagram for adaptivelyprovisioning sequence numbers in a clustered database environment,according to some embodiments of the present disclosure.

FIG. 3 illustrates more details about adaptively provisioning unorderedsequence numbers with independent cache based at least in part upon thehigh-watermark for sequence numbers in a clustered database environment,according to some embodiments of the present disclosure.

FIG. 4 illustrates more details about adaptively provisioning orderedsequence numbers with shared cache based at least in part upon one ormore other caches for sequence numbers in a clustered databaseenvironment, according to some embodiments of the present disclosure.

FIGS. 5A-5D illustrate some examples for adaptively provisioningunordered sequence numbers with independent cache based at least in partupon the high-watermark for sequence numbers, according to someembodiments of the present disclosure.

FIGS. 6A-6G illustrate some examples for adaptively provisioning orderedsequence numbers with shared cache based at least in part upon one ormore other caches for sequence numbers, according to some embodiments ofthe present disclosure.

FIG. 7 illustrates a block diagram of an illustrative computing systemsuitable for implementing some embodiment of the present disclosure.

FIG. 8 illustrates a block diagram of one or more components of a systemenvironment by which adaptive provisioning of sequence numbers in aclustered database environment is provided, in accordance with anembodiment of the present disclosure.

DETAILED DESCRIPTION

Various embodiments will now be described in detail, which are providedas illustrative examples of the disclosure so as to enable those skilledin the art to practice the disclosure. Notably, the figures and theexamples below are not meant to limit the scope of the presentdisclosure. Where certain elements of the present disclosure may bepartially or fully implemented using known components (or methods orprocesses), only those portions of such known components (or methods orprocesses) that are necessary for an understanding of the presentdisclosure will be described, and the detailed descriptions of otherportions of such known components (or methods or processes) will beomitted so as not to obscure the disclosure. Further, variousembodiments encompass present and future known equivalents to thecomponents referred to herein by way of illustration.

Overview

As previously noted, both ordered and unordered sequences have wideapplications in databases. Various embodiments described herein providean improved approach to adaptively ordered and/or unordered sequencenumbers in any database environment, particularly in a clustereddatabase environment where multiple entities (e.g., sessions, instances,computing nodes, etc.) respectively request sequence numbers to addressat least the aforementioned shortcomings of alternative approaches.

In some of these embodiments where sequence numbers are requested, thenumber of sequence numbers and/or a size of a data structure (e.g.,cache memory) that temporarily stores a list of sequence numbersobtained from, for example a disk, is adaptively determined based atleast in part upon one or more factors after the sequence numbers storedin the data structure have been consumed. As used herein, the term‘cache” as applied to sequence numbers corresponds to a logicalallocation of a set of sequence numbers, e.g., where the cache storesthe list of allocated sequence numbers and/or a logical list comprisinga start position and an end position for a given sequence. In theseembodiments, the tern “cache” or ‘cache size” does not necessarily referas such to a size of a memory structure for holding the sequence(although any suitable medium such as memory may be used to holdsequence number values), but instead refers to the logicalrepresentation of the sequence numbers as having a given number ofvalues, e.g., where a larger cache comprises logically more numbers anda smaller cache comprises logically less numbers. In an alternateembodiment, the “cache” term does refer to a physical amount of storagethat is set aside for the sequence numbers, where a larger cacheindicates that more physical space is set aside in the cache as opposedto a smaller cache of sequence numbers that corresponds to a smallerallocation of memory/storage.

As previously noted, one or more factors may be used to dynamicallydetermine the number of sequence values to be allocated. These one ormore factors may include, for example, the next available sequencenumber for the database system in which the entity executes, thehigh-watermark indicative of the currently maximum sequence numberdeployed (e.g., to a data structure storing sequence numbers for use bya computing entity) in the database system, information concerning howthe list of sequence numbers has been consumed (e.g., a consumptionrate), or a projected time period for which the next list of sequencenumbers is to be determined, or any other suitable factors, or anycombinations thereof.

For example, at the time or after an existing list of sequence numbershas been fully consumed, a new list of sequence numbers with the same ordifferent total number of sequence numbers (e.g., by determining a cacheof a larger size, a smaller size, or the same size) may be adaptivelydetermined based at least in part upon, for example, how fast theexisting list of sequence numbers was previously consumed. In theseembodiments, the next list of sequence numbers may be independentlydetermined for one entity from that for another entity. Multipleentities may thus independently (e.g., in parallel) consume andreplenish their respective cached sequence numbers without waiting forother entities while achieving an improved or optimized balance betweenperformance and mitigated risk of productivity loss. These embodimentsnot only provide the aforementioned advantages but are also highlyscalable, particularly for a clustered database environment.

As described in more detail below, in some other embodiments whereordered sequence numbers are required or enforced across multipleinstances/nodes, multiple nodes/entities “share” a data structure inthat the respective data structures temporarily storing respective listsof sequence numbers may be first populated with the same or overlappingsequence values while the database system in which these multipleentities execute maintains the next available sequence number (e.g., byusing a Nextval pointer) and the high-watermark.

In some embodiments, the adaptive sizing of computing entity's cache forsequence numbers is performed based at least in part upon the computingentity's consumption of at least some of the sequence numbers. In someother embodiments, the adaptive sizing of a first computing entity'sdata structure is based at least in part upon one or more othercomputing entities' consumption of sequence numbers.

With a new size of the cache determined, this cache may be populatedwith next available sequence numbers based at least in part upon, forexample, the next available sequence numbers, and/or the high-watermark,etc. The computing entity may then start consuming at least one of thenewly populated sequence numbers.

When another computing entity (e.g., a second computing entity) requestsa sequence number, the data structure for the second computing entitymay be updated to include at least the available sequence numbers (e.g.,the remaining sequence numbers in the first computing entity's datastructure after the first computing entity has consumed at least one ofthe newly populated sequence numbers). After its cache storing theseavailable sequence numbers is updated, the second computing entity maystart consuming at least one of the available sequence numbers in itscache. Each time a computing entity consumed a sequence number, thenextval pointer is moved to the next available sequence number (e.g., bymodifying the metadata associated with sequence numbers), and thisinformation may be made available to all the computing entities thatrequest their respective ordered sequence numbers so that the orderingof sequences is enforced in the database environment.

In some embodiments, when the existing sequence numbers stored in acache for a computing entity are consumed, an adaptive sequence numberengine (e.g., 108 in FIG. 1 ) may be invoked to determine an adaptivesize of the cache. The adaptive size of the cache may be determinedbased at least in part upon how quickly the computing entity aloneconsumed the sequence numbers stored in the cache in some embodiments oron how quickly the computing entity and one or more other computingentities consumed the sequence numbers that were populated into theirrespectively caches and were jointly consumed by the computing entityand the one or more other computing entities or singularly consumed byany one of the one or more other computing entities. More details aboutvarious embodiments of the present disclosure are described below in theDetailed Description section.

Some of the terms used in this description are defined below for easyreference. The presented terms and their respective definitions are notrigidly restricted to these definitions—a term may be further defined bythe term's use within this disclosure. As used in this application andthe appended claims, the term “or” is intended to mean an inclusive “or”rather than an exclusive “or”. That is, unless specified otherwise, oris clear from the context, “X employs A or B” is intended to mean any ofthe natural inclusive permutations. That is, if X employs A, X employsB, or X employs both A and B, then “X employs A or B” is satisfied underany of the foregoing instances. As used herein, at least one of A or Bmeans at least one of A, or at least one of B, or at least one of both Aand B. In other words, this phrase is disjunctive. The articles “a” and“an” as used in this application and the appended claims shouldgenerally be construed to mean “one or more” unless specified otherwiseor is clear from the context to be directed to a singular form.

Reference is now made in detail to certain embodiments. The disclosedembodiments are not intended to be limiting of the claims.

Descriptions of Example Embodiments

Various embodiments will now be described in detail, which are providedas illustrative examples of the invention so as to enable those skilledin the art to practice the invention. Notably, the figures and theexamples below are not meant to limit the scope of the presentinvention. Where certain elements of the present invention may bepartially or fully implemented using known components (or methods orprocesses), only those portions of such known components (or methods orprocesses) that are necessary for an understanding of the presentinvention will be described, and the detailed descriptions of otherportions of such known components (or methods or processes) will beomitted so as not to obscure the invention. Further, various embodimentsencompass present and future known equivalents to the componentsreferred to herein by way of illustration.

Various embodiments described herein provide an improved approach toadaptively provision sequence numbers in any database environment,particularly in a clustered database environment where multiple entities(e.g., sessions, instances, computing nodes, etc.) respectively requestsequence numbers to address at least the aforementioned shortcomings ofconventional approaches.

FIG. 1 illustrates a schematic diagram of a system for adaptivelyprovisioning sequence numbers in a clustered database environment,according to some embodiments of the present disclosure. Morespecifically, FIG. 1 illustrates that during time period 1 (100), acomputing entity 102 (e.g., an instance) in the database environmentissues a request 106 for one or more sequence numbers where all of thesequence numbers (“1”-“20”) temporarily stored in the data structure 104have been consumed.

In response to the request for one or more sequence numbers issued bythe computing entity 102, an adaptive sequence number engine 108 maydetermine an adaptive size of the cache/data structure 104 of the nextlist of sequence numbers for the computing entity 102. For example, theadaptive sequence number engine 108 may determine how quickly thecurrent sequence numbers in the data structure 104 were consumed. Forexample, the adaptive sequence number engine 108 may determine that thesequence number consumption rate is 20 sequence numbers for the timeperiod 1 (100) (which may be referred to as a consumption time period asillustrated in 504B of FIG. 5B).

The adaptive sequence number engine 108 may then use this determinationresult to determine the adaptive size of the next list of sequencenumbers 116 for a projected future time period 114. In some embodiments,the adaptive sequence number engine 108 may increase, decrease, ormaintain the original size of the cache/data structure 104 for the newlydetermined adaptive size based at least in part upon one or morefactors. In this example illustrated in FIG. 1 , the original size ofthe data structure 104 accommodates twenty (20) sequence numbers, andthe newly determined adaptive size of the data structure accommodateseighty (80) sequence numbers. In some of these embodiments, these one ormore factors may include, for example, how quickly sequence numbers wereconsumed in the current time period (e.g., 100 in FIG. 1 ), the lengthof the projected future time period (114), the current nextval or thelast sequence number consumed, the current high-watermark indicative ofthe largest sequence number that has been allocated to a data structurefor consumption, and/or any other suitable factors, or any combinationsthereof.

With the adaptive size of the next list of sequence numbers, the firstcache/data structure 104 may be reconfigured into the second cache/datastructure 104A to accommodate the next list of sequence numbers. Anextval pointer 120 may be moved to point to the next available sequencenumber (“21” in this example in FIG. 1 ) for the computing entity 102 toconsume.

The consumption information that is used to determine the next set ofsequence numbers may comprise any suitable information regarding pastconsumption. In one embodiment, the consumption information comprises arate of consumption for a previous set of sequence numbers (e.g., numberof sequence values consumed per second in the previous time period). Inan alternate embodiment, the consumption rate may be derived as anaggregated or composite rate value established over any number ofprevious consumption cycles.

The projected time period may correspond to any suitable time period forcomputation and analysis purposes. In one embodiment, the projected timeperiod corresponds to a fixed next time period, e.g., a fixed 10 secondtime period. In an alternative embodiment, the time period may beconfigurable, e.g., configured manually by a user. In yet anotherembodiment, the time period may be adaptively determined. For example,during a period of high projected volatility with respect to consumptionor consumption rates, the next time period may be set to a relative lowtime duration. However, during a period of low projected volatility, thenext time period may be set to a longer time duration.

With one current embodiment, the next set of sequence numbers cantherefore be established by multiplying a rate of consumption by theprojected time period.

FIG. 2 illustrates a high-level block diagram for adaptivelyprovisioning sequence numbers in a clustered database environment,according to some embodiments of the present disclosure. The high-levelblock diagram illustrated in FIG. 2 applies to both ordered sequencesand unordered sequences across multiple nodes. In these embodimentsillustrated in FIG. 2 , a cached or stored list of sequence numbers maybe identified at 202. In some of these embodiments, a cached list ofsequence numbers may be stored in a cache memory.

It shall nevertheless be noted that part of the present disclosurerefers to the term “cache” or “cached” to indicate the temporary storageof sequence numbers for consumption, and that although such temporarystorage may be accomplished with a cache memory, the use of the term“cache” or “cached” does not intend to limit the scope of otherembodiments or the scope of the claims unless otherwise explicitlydescribed or recited. In some embodiments, sequence numbers may begenerated by, for example, a sequence number generator of a databasesystem, and the generated sequence numbers may be stored in a persistentor non-persistent storage for the database environment to use. In theseembodiments, a list of these generated sequence numbers may be read fromthe persistent storage and placed in a temporary storage for consumptionby computing entities. Such a temporary storage may be accomplished withany suitable data structure stored in any non-transitory computerreadable media so long as the database environment need not return tothe persistent storage to retrieve one or more sequence numbers everytime a request for sequence numbers is received.

A request for one or more sequence numbers may be received from arequesting entity at 204. The request from the requesting entity may befulfilled by obtaining the one or more sequence numbers from the list ofsequence numbers identified at 202. A requesting entity may include, forexample, a session, an instance, or a computing node, etc. For example,a requesting entity may be a database session of a database instance, anapplication session of an application instance, a service session of aninstance of a service or microservice, an instance of an application, aninstance of a database, an instance of a service or microservice, or anyother suitable computing entities.

A determination may be made at 206 to decide whether the requestreceived at 204 is for sequence numbers that are ordered across multipleinstance/nodes, or not across multiple instances/nodes. As describedabove, an “ordered” sequence enforces a strict ordering on the sequencevalues (or sequence numbers) returned. For example, if entity oneadvances the sequence before session two, then session one sees asequence value that is earlier in the sequence's value range thansession two. Sequence ordering may be enforced by serializing on thesequence's nextval (or next value).

In some embodiments where the request received at 204 is directed to asequence number not ordered across nodes, then an independent cache/datastructure (independent from other nodes) may be utilized at 208 to storesequence numbers for consumption. For example, instance one maycorrespond to a first data structure, and instance two may correspond toa second data structure, where the first and the second data structuresare independently filled with their respective lists of sequence numbersfor consumption. In these embodiments, sequence ordering across nodes isnot strictly enforced.

For example, the first data structure may be populated with sequencenumbers 1-20 for instance one, and the second data structure may bepopulated with sequence numbers 41-60 for instance two. In this example,session one of instance one may acquire a lock, consumes sequence number“1”, and then releases the lock. Session two of instance two may acquirethe lock after session one has released the lock, consumes the nextavailable sequence number “41”, and releases the lock. Session one mayre-require the lock after session two has released the lock and consumesthe next available sequence number “2”. In this example, the sequencevalues in the database environment are then “1”-“41”-“2” so the sequenceordering is not enforced.

In some embodiments where the request received at 204 is directed to anordered sequence number, a “shared” mechanism may be adopted at 210. Insome embodiments, the “shared” mechanism is adopted based at least inpart upon one or more other entities that also issue and consumesequence number(s). It shall be noted that the “shared” data structuremechanism does not necessarily refer to using the same data structurefor multiple computing entities in some embodiments. In theseembodiments, a “shared” data structure mechanism for temporarily storingsequence numbers for consumption includes adaptively determining a newlist of ordered sequence numbers having a newly determined adaptive sizeof a data structure for a requesting entity based at least in part uponhow quickly the current sequence numbers were consumed and configuringthe data structure for a separate entity with the newly determinedadaptive size and populating at least a portion of the new list ofordered sequence numbers to the configured data structure. The pastconsumption rate, in some embodiments, may therefore be based at leastin part upon the consumption by multiple nodes/entities.

In some embodiments where the request received at 204 is directed to asequence number not ordered across multiple nodes, an independent datastructure may be adopted for an entity at 208. In some embodiments, eachentity (e.g., instance) may correspond to a data structure so that theentity or one or more child entities (e.g., sessions of an instance) mayconsume sequence numbers stored therein. Each data structure may bepopulated with its own sequence numbers obtained from the databaseenvironment.

For example, each of multiple instances in a clustered databaseenvironment may correspond to a respective data structure (e.g., cache).These respective data structures may be respectively populated withcorresponding lists of sequence numbers where each corresponding list ofsequence numbers is obtained from the database environment (e.g., from asequence number generator). In this example, multiple child entitiessuch as multiple sessions of an instance may independently consume thelist of sequence numbers stored in the cache for the instance.

For example, a first data structure may be populated with sequencenumbers 1-20 for a first instance in a clustered database environment,and a second data structure may be populated with sequence numbers 41-60for a second instance in the clustered database environment. The firstinstance or one or more sessions thereof may independently consume thesequence numbers in the first data structure. Similarly, the secondinstance or one or more sessions thereof may also independently consumethe sequence numbers in the second data structure. When the sequencenumbers of one data structure have been fully consumed, the datastructure may be independently, adaptively resized with a differentsize, and the adaptively resized data structure may be populated with anew list of sequence numbers independent of other instances in theclustered database environment. More details about reference numerals208 and 210 will be described below.

FIG. 3 illustrates more details about adaptively provisioning unorderedsequence numbers with independent cache based at least in part upon thehigh-watermark for sequence numbers in a clustered database environment,according to some embodiments of the present disclosure. Morespecifically, FIG. 3 illustrates more details about the independent datastructure mechanism for unordered sequence numbers in FIG. 2 . In theseembodiments, a data structure populated with sequence numbers may beidentified at 302. A request for one or more sequence numbers may bereceived at 304 from a requesting entity. For example, a session of aninstance may issue a request to obtain one or more sequence numbers fromthe data structure identified at 302.

A requested sequence number, if available in the data structure, may beprovided to the requesting entity at 306. In some embodiments where therequest for sequence numbers received at 304 has not been fulfilled, adetermination may be made at 308 to decide whether the sequence numbersin the data structure have all already been consumed. If thedetermination result is negative (e.g., the data structure stillincludes one or more available sequence numbers), the process may returnto 306 to continue to provide the next available sequence number to therequesting entity.

On the other hand, if the determination is affirmative at 308 (e.g., allsequence numbers populated in the data structure have been consumed), anew list of sequence numbers may be adaptively determined at 310 withpossibly a different size (e.g., a size that accommodates a differenttotal number of sequence numbers). The adaptive determination at 310 maybe performed based at least in part upon one or more factors such as howquickly the sequence numbers in the data structure identified at 302were consumed and/or a high-watermark of sequence numbers in thedatabase environment, or any other desired or required criteria.

With the new list of sequence numbers adaptively determined at 310, thedata structure may be reconfigured with the newly determined adaptivesize and replenished with the new list of sequence numbers at 312. Theprocess may return to 304 to receive a request for one or more sequencenumbers. If the original request identified above has not beenfulfilled, the process may proceed through one or more of the previousactions, if necessary, until the request is fulfilled. On the otherhand, if the original request has already been fulfilled before theprocess returns to 304, a new request for one or more sequence numbersmay be identified at 304, and the process repeats for this new request.

In some embodiments, the process illustrated in FIG. 3 may beindependently performed for each data structure in the databaseenvironment for one or more computing entities to consume the sequencenumbers stored in the data structure, independent of and separate fromother data structures storing their respective lists of sequencenumbers. In these embodiments, a data structure may be accessed bycomputing entities supported by the data structure; each data structuremay also be independently, adaptively resized to have a larger size, asmaller size, or the same size based at least in part upon theaforementioned one or more factors or criteria; and each data structuremay then be populated with new lists of sequence numbers.

FIG. 4 illustrates more details about adaptively provisioning orderedsequence numbers with shared cache based at least in part upon one ormore other caches for sequence numbers in a clustered databaseenvironment, according to some embodiments of the present disclosure.More specifically, FIG. 4 illustrates the shared data structuremechanism for ordered sequence numbers, according to some embodiments ofthe present disclosure.

In these embodiments, a request for one or more sequence numbers may beidentified at 402 from a requesting entity. For example, a request forone or more sequence numbers may be received from a requesting sessionof a first instance and/or node at 402. A cached list of sequencenumbers may be updated at 404 for the requesting entity with sequencenumbers that are adaptively generated. In some embodiments, an adaptivesize of a data structure may be adaptively determined based at least inpart upon, for example, how quickly the current sequence numbers wereconsumed as described above with reference to FIGS. 2-3 .

With the cached list of sequence numbers updated at 404, otherinformation pertaining to the adaptively generated sequence numbers mayalso be updated at 406 for the requesting entity. For example, thehigh-watermark, the next available sequence number, etc. may be updatedat 406 for the requesting entity.

The requesting entity may then start consuming one or more sequencenumbers in the cached list of sequence numbers at 408. If the requestingentity fully consumed all of the sequence numbers in the cached list ofsequence numbers to fulfill its request, the cached list may be furtherupdated with a new batch of adaptively generated sequence numbers assimilarly described with reference to 404. On the other hand, in someembodiments where the requesting entity does not fully consume all ofthe sequence numbers in the cached list of sequence numbers, a separaterequest for one or more sequence numbers may be received at 410 from aseparate requesting entity.

This separate requesting entity may update a separate cached list ofsequence numbers at 412 based at least in part upon the high-watermarkand the next available sequence number (nextval). This separaterequesting entity may start consuming one or more sequence numbers fromthe updated cached list of sequence numbers at 414.

A determination may be made to decide whether all the sequence numbersin the updated cached list of sequence numbers have been fully consumedat 416. In some embodiments where the determination result is negative(e.g., not all of the sequence numbers have been consumed), the processmay return to 414 to continue to consume the sequence number(s). On theother hand, if it is determined that all of the sequence numbers in thecached list of sequence numbers have been fully consumed at 416, theprocess may return to 402 where the separate request is againidentified, and the separate requesting entity may again update itscached list of sequence numbers at 404, and update the high-watermarkand the next available sequence number at 406 so that the separaterequesting entity may again consume one or more sequence numbers at 408to fulfill the separate request. The process then repeats the remainingactions from 410 for one or more other requests in an identical orsubstantially similar manner as that described above for FIG. 4 .

FIGS. 5A-5D illustrate some examples for adaptively provisioningsequence numbers with an independent cache based at least in part uponthe high-watermark for sequence numbers, according to some embodimentsof the present disclosure. More particularly, FIG. 5A illustrates anexample where computing entities in a database environment requestsequence numbers not ordered across nodes and/or instances. In thisexample, the computing entities independently consume their respectivesequence numbers stored in their respective data structures. Moreover,the size of each data structure for its corresponding computing entityis independently, adaptively resized as described herein.

In these embodiments, the database environment includes one or moreinstances (e.g., 502A, 506A, etc.) An instance (e.g., instance one 502A,instance N 506A, etc.) may correspond to one or more sessions (e.g., S₁,S₂, or S₃, etc. for instance one 502A or S₄, S₅, or S₆, etc. forinstance one 506A). The examples illustrated in FIGS. 5A-5D apply withfull and equal effects to a database environment having one computingentity (e.g., a session, an instance, a computing node, etc.) ormultiple computing entities.

A computing entity may correspond to a data structure (e.g., cache 504Afor instance one 502A, cache 508A for instance N 506A, etc.) that storesa plurality of sequence numbers obtained from, for example, an sequencenumber engine (e.g., 108 in FIG. 1 ). When the computing entity requesta sequence number, the next available sequence number, if available, inthe data structure is provided to the computing entity to fulfill itsrequest.

The example illustrated in FIG. 5A shows the case where all the sequencenumbers stored in the data structure 504A have been consumed by thecomputing entity (e.g., one or more of the sessions S₁, S₂, or S₃, etc.)At the time or after all the sequence numbers stored in the datastructure are consumed, the adaptive sequence number engine (108) maydetermine an adaptive size for the data structure 504A, and a new listof sequence numbers (510A) may be obtained from a disk or other storagedevice storing sequence numbers generated by, for example, a sequencenumber generator based at least in part upon the newly determinedadaptive size for the data structure 504A. This new list of sequencenumbers 510A may then be populated into the data structure 504A, and thenext available sequence number (“Nextval”) pointer may be reset to thefirst available sequence number (e.g., the smallest available sequencenumber in the new list) for the next requesting entity to consume.

FIG. 5B continues the example from FIG. 5A and illustrates that at thetime or after all the sequence numbers stored in the data structure areconsumed, the adaptive sequence number engine (108) may determine anadaptive size for the data structure 504A based at least in part uponone or more factors. These one or more factors may include, for example,how quickly the existing sequence numbers in the data structure 504Awere consumed by the computing entity (e.g., instance one 502A), howlong the future time period for which the next list of sequence numberswill be generated, or any other desired or required factors, or anycombinations thereof. For example, the one or more factors may includethe consumption rate 508B, the next projected time period 512B, etc.

In some embodiments, the consumption rate of sequence numbers may bedetermined based on the time period 504B during which the existingsequence numbers in the data structure were consumed. For example,assuming the first sequence number (“1” in this example) of the existingsequence numbers in the data structure 504A was first consumed at timeT₀, and the last sequence number (“52” in this example) was consumed attime T₁ so that a total of N sequence numbers have been fully consumedbetween T₁−T₀, the consumption rate of the existing sequence numbers indata structure 504A may be determined to be:

N/(T₁−T₀)

For the next projected time period (T₂−T₁) 510B for which a new adaptivesize for the data structure 504A is to be determined is T₂−T₁, theadaptive size of the data structure may be determined to be:

N*(T₂−T₁)/(T₁−T₀)

As it may be appreciated by those skilled in the art, the adaptive sizeof a data structure described herein may increase or decrease. In someembodiments where a lower threshold size “s” (or a “lower bound”) may beset to control the smallest size of the data structure 504A, theadaptive size of the data structure may be determined to be:

Max(s,N*(T₂−T₁)/(T₁−T₀))

In these embodiments, the size of the data structure is determined notto decrease below the lower threshold size even though the adaptivesequence number engine may decrease the adaptive size. In some of theseembodiments, a lower threshold ratio “s”, rather than a lower thresholdsize, may also be set to limit the ratio at which the size of a datastructure may decrease. For example, a lower threshold ratio may be setin such a way that a new adaptive size of a data structure will not dropbelow, for example, one-half of the immediately previous size.

In addition or in the alternative, an upper threshold size or an upperthreshold ratio “S” may be set to control the maximize size or themaximum rate of size increase for the data structure. For example, thesize of a cache/data structure may be limited not to increase beyond1,000 sequence numbers or not to increase more than ten times (10×) ofthe immediately preceding size of the data structure.

Either or both of the next projected time period 512B and theconsumption time period 504B may have their respective default valuesand may be customizable by, for example, a user in some embodiments. Inaddition or in the alternative, either or both of the next projectedtime period 512B and the consumption time period 504B may be customizedprogrammatically by the database system (e.g., by the adaptive sequencenumber engine 108 in FIG. 1 ) based at least in part upon, for example,one or more criteria such as a performance metric of the database systemalone, a likelihood of productivity alone, a balanced account for theperformance of the database system and a likelihood of productivityloss, heuristics, historical patterns of the database performance metricand/or the likelihood or actual occurrence of productivity losses, orany other suitable criteria, or any combinations thereof.

A new list of sequence numbers (510A) may be obtained from a disk orother storage device storing sequence numbers generated by, for example,a sequence number generator based at least in part upon the newlydetermined adaptive size for the data structure 504A. This new list ofsequence numbers 510A may then be populated into the data structure504A, and the next available sequence number (“Nextval”) pointer may bereset to the first available sequence number (e.g., the smallestavailable sequence number in the new list) for the next requestingentity to consume.

FIG. 5C continues the example and illustrates various example inputs500C that an adaptive sequence number engine 108 may consider indetermining a new, adaptive size for a data structure (e.g., 504A) sothat the new data structure (e.g., 506B) may accommodate a new list ofsequence numbers based at least in part upon this new, adaptive size.

In determining the new, adaptive size, the adaptive sequence numberengine 108 may consider the input 500C that may include, for example,one or more factors. These one or more factors may include, for example,the total number of sequence numbers consumed (504C), the time period orduration during which the total number of sequence numbers were consumed(506C), the next projected time period (508C), the next availablesequence number in the sequence (510C), the high-watermark 510C, or anyother desired or required factors, or any combinations thereof.

In this example, the adaptive sequence number engine 108 may considerone or more of the aforementioned factors as an input 500C to theadaptive sequence number engine 108 and determines to increase thecurrent size (that accommodates 52 sequence numbers) to the new,adaptive size that accommodates 148 sequence numbers (e.g., 53, 54, . .. , 200) as the data structure 506B.

FIG. 5D illustrates the example where once the new, adaptive size isdetermined for the data structure 506B for the next future time period512B, a new list of sequence numbers may be populated into the datastructure 506B as shown in FIG. 5D.

FIGS. 6A-6G illustrate some examples for adaptively provisioning orderedsequence numbers with shared cache based at least in part upon one ormore other caches for sequence numbers, according to some embodiments ofthe present disclosure. More particularly, FIG. 6A illustrates anexample where a database environment includes a shared storage 620A andtwo instances (instance one 602A and instance two 616A) each having oneor more entities (e.g., S₁, S₂, or S₃, etc. 614A for instance one 602Aor S₄, or S₅, etc. 626A for instance two 616A) that may issue theirrespective requests for ordered sequence numbers. Again, it shall benoted that various embodiments described herein apply with full andequal effects to one or more computing entities where a computing entitymay be a standalone entity in some embodiments or may correspond to aparent computing entity in some other embodiments. For example, acomputing entity or an entity may include, for example, a process, asession (e.g., a session of a database instance, a session of anapplication instance, etc.), an instance, a computing node, etc.

In this example database environment illustrated in FIG. 6A, eachinstance may include its own instance of a distributed lock mechanism(DLM) (e.g., DLM1 612A for instance 602A, DLM2 624A for instance 616A,etc.) that may acquire a lock to access a sequence number.

An instance may correspond to its own data structure for storing orderedsequence numbers generated by, for example, a sequence number generator(e.g., the adaptive sequence number engine 108 in FIG. 1 ) that maydetermine and coordinate the data structures for the multiple instancesrequesting ordered sequence numbers in the database environment. Forexample, instance one 602A may correspond to a first data structure604A, and instance two 616A may correspond to a second data structure618A. A data structure temporarily stores a list of ordered sequencenumbers generated by a sequence number generator and may comprise, forexample, a cache with the head of the cache (606A or 620A) and the tailof the cache (608A or 622A) so that information corresponding torequests for ordered sequence numbers may be stored accordingly. Itshall be noted that other suitable data structures may also be utilized,and that the present disclosure may refer to the term “cache” for theease of description and illustration without limiting the scope ofvarious embodiments described herein or the claims, unless otherwiseexplicitly described or recited.

In these embodiments illustrated in FIGS. 6A-6G, ordered sequences areenforced by using at least a “shared” cache mechanism. Morespecifically, the two caches (604A and 618A) may be initially configuredwith the same default size and populated with the same list of orderedsequence numbers (e.g., 1, 2, 3, . . . , 20 in this example in FIG. 6A).FIG. 6A further illustrates the example where no entities have requestedordered sequence numbers at time T₀ along the temporal axis 650A. As aresult, the nextval pointer (pointer 638A for cache 604A and pointer648A for cache 618A) are both pointing at the next available orderedsequence number “1”.

FIG. 6A further illustrates that the database environment may furtherstore data 632A such as the object identification or number 640A, thedefault or current cache size 642A, the high-watermark 644A, etc. Atleast some of the data 632A may be referenced by, for example, theadaptive sequence number engine 650A, the sequence number enqueuingmechanism 628A, etc. to facilitate the “shared” cache mechanism. Theobject number corresponds to an identifier for a particular sequencewithin the database system. It is noted that the database system mayemploy multiple separate sequences in various contexts within thesystem, and each separate sequence is represented as a separate rowwithin structure 632A with a different object number. The cache columncorresponds to the number of sequence numbers within a given cache forthe sequence. The high watermark column identifies the high watermarkfor the sequence values for its respective sequence. In someembodiments, the structure 632A is represented on disk and is accessibleby some or all of the distributed instances/nodes.

FIG. 6B continues with the example illustrated in FIG. 6A andillustrates that at time point T₁, it is determined that an entitycorresponding to instance one 602A has acquired the lock 660A throughthe first DLM 612A and consumed a first ordered sequence number (“1” inthis example) and moved the nextval pointer 638A to the next availableordered sequence number (“2” in this example). The entity may thenrelease the lock 660A. Subsequently at time point T₂ after time pointT₁, it is further determined that another entity corresponding toinstance two 616A has acquired the lock 660A through the second DLM 624Aand consumed three ordered sequence number (“2,” “3,” and “4” in thisexample) and moved the nextval pointer 648A to the next availableordered sequence number (“5” as shown in the data structure 646A). Thecurrent high-watermark indicating the maximum or largest orderedsequence number allocated is “20” in the example data structure 646Awhich may be referenced by the adaptive sequence number engine 650Aand/or the sequence number enqueuing module 628A. It is noted that insome embodiments, the structure 646A corresponds to an in-memorystructure that is accessible through a shared memory implementation toeach of the instances/nodes.

FIG. 6C further continues with the example illustrated in FIG. 6B.Subsequently at time point T₃ after time point T₂, it is furtherdetermined that the entity corresponding to instance two 616A continueto hold the lock 660A and consumes all the remaining ordered sequencenumber (“5,” “6,” . . . , “20” in this example). The nextval value indata structure 646A is thus updated to “21” while the high-watermarkremains at 20 as the largest allocated ordered sequence number. Assumingthat no other entities request ordered sequence numbers, FIG. 6C thusillustrates a transient state of the database environment after all theallocated ordered sequence numbers have been consumed.

It is noted that the nextval pointer 638A for the first data structure604A may still currently correspond to what it (wrongly) believes is thenext available ordered sequence number (“2” in this example), since noentity corresponding to instance one 602A has recently requested anordered sequence numbers, and thus is out-of-date. As described in moredetail below, there is no conflict since the first instance does nothave any entities that are currently requesting a number and thus thereis no harm to have its structure temporarily point to the wrong nextavailable value at the current time, but as described in more detailbelow, will be corrected when the need arises in the future.

FIG. 6D continues with the example illustrated in FIG. 6C and furtherillustrates the example where an entity corresponding to instance one602A now requests one or more ordered sequence numbers at time point T₄after it is determined that all the ordered sequence numbers 1-20 havebeen consumed at time point T₃. As described above with reference toFIG. 6C, the nextval pointer 638A for the first data structure 604A maystill correspond to the next available ordered sequence number (“2” inthis example) as no entity corresponding to instance one 602A hasrequested ordered sequence numbers since the entity consumed thesequence number “1” at the time point

In this example, the adaptive sequence number engine 650A may determinean adaptive size for the data structure 604A by using identical orsubstantially similar approaches described herein. For example, theadaptive sequence number engine 650A may determine how quickly thecurrent list of ordered sequence numbers were consumed (e.g., by acombination of both instances 1 and 2) and determine the adaptive sizeof the data structure 604A to be “40” for the next projected timeperiod. The next list of ordered sequence numbers (“21,” “22,” . . . ,“60”) may thus be determined based on the Nextval “21” and the new size“40”, and the high-watermark may be updated to the largest allocatedordered sequence number (“60” in this example). Because no other orderedsequence numbers have been consumed since time point T₃, the Nextvalindicates the next available ordered sequence number to be “21”.

It shall be noted that the data structure 618A still shows the previous,consumed 20 ordered sequence numbers in FIG. 6D. As described above,entities corresponding to instance two 616A have not requested orderedsequence numbers after all 20 ordered sequence numbers have beenconsumed at time point T₃. In some embodiments, the data structure 618Aremains unchanged until the next time an entity corresponding toinstance two 616A requests one or more ordered sequence numbers,although the data structure 604A has already been updated to accommodatethe new list of 40 ordered sequence numbers. In some other embodiments,the database environment (e.g., the adaptive sequence number engine) mayupdate multiple data structures with the new, adaptive size and the newlist of ordered sequence numbers when a request for ordered sequencenumber(s) from one entity triggers the determination of the adaptivesize of its corresponding data structure (e.g., 604A in this example).

FIG. 6E continues the example in FIG. 6D and further illustrates that ata subsequent time point T₅, an entity corresponding to instance one 602Ais determined to have acquired the lock 660A and consumed orderedsequence numbers 21 and 22 in the new list of ordered sequence numbersand moved the nextval pointer to the next available ordered sequencenumber (“23” in this example). The nextval in the data structure 646A isalso updated to “23” to ensure that ordered sequences are enforced inthe database environment.

FIG. 6F continues the example in FIG. 6E and further illustrates that ata subsequent time point T₆, an entity corresponding to instance two 616Arequests for one or more ordered sequence numbers at time point T₆. Inthese examples, the data structure 618A still shows the previous list ofordered sequence numbers (1-20) since the last access to orderedsequence numbers at time point T₃. The database environment (e.g.,through the adaptive sequence number engine 650A) may reference thenextval “23” and the high-watermark “60” in the data structure 646A toreconfigure the data structure 618A to accommodate the new list ofordered sequence numbers (21-60) in some embodiments. In some otherembodiments, the data structure is populated with at least the orderedsequence numbers from the next available ordered sequence number “23” tothe current high-watermark “60” (e.g., 23-60) as illustrated in FIG.6F-1 . The nextval pointer 648A for data structure 618A points to thenext available ordered sequence number “23” in these examples accordingto the nextval data in data structure 646A, regardless of how the datastructure 618A is populated.

FIG. 6G continues the example in FIG. 6F or FIG. 6F-1 and furtherillustrates that the entity corresponding to instance two 616A acquiresthe lock 660A and starts consuming the next available ordered sequencenumber (“23” in this example), and the nextval pointer 648A is moved tothe current next available ordered sequence number “24”. The nextvaldata in the data structure 646A may also be updated to reflect thecurrent next available ordered sequence number “24” so that orderedsequences may be enforced among the multiple computing entities thatrequest for ordered sequence numbers in the database environment.

Therefore, what has been described is an improved approach to adaptivelyprovision the number of sequence values in a database environment. Thepresent embodiments provide a technique or techniques to address atleast the aforementioned shortcomings of conventional approaches andalso to improve over various conventional approaches.

System Architecture Overview

FIG. 7 is a block diagram of an illustrative computing system 700suitable for implementing an embodiment of the present disclosure.Computer system 700 includes a bus 706 or other communication mechanismfor communicating information, which interconnects subsystems anddevices, such as processor 707, system memory 708 (e.g., RAM), staticstorage device 709 (e.g., ROM), disk drive 710 (e.g., magnetic oroptical), communication interface 714 (e.g., modem or Ethernet card),display 711 (e.g., CRT or LCD), input device 712 (e.g., keyboard), datainterface 733, and cursor control.

According to some embodiments of the disclosure, computer system 700performs specific operations by processor 707 executing one or moresequences of one or more instructions included in system memory 708.Such instructions may be read into system memory 708 from anothernon-transitory computer readable/usable medium, such as static storagedevice 709 or disk drive 710. In alternative embodiments, hard-wiredcircuitry may be used in place of or in combination with softwareinstructions to implement the disclosure. Thus, embodiments of thedisclosure are not limited to any specific combination of hardwarecircuitry and/or software. In some embodiments, the term “logic” shallmean any combination of software or hardware that is used to implementall or part of the disclosure.

The term non-transitory “computer readable medium” or “computer usablemedium” as used herein refers to any medium that participates inproviding instructions to processor 707 for execution. Such a medium maytake many forms, including but not limited to, non-volatile media andvolatile media. Non-volatile media includes, for example, optical ormagnetic disks, such as disk drive 710. Volatile media includes dynamicmemory, such as system memory 708.

Common forms of non-transitory computer readable media include, forexample, floppy disk, flexible disk, hard disk, magnetic tape, any othermagnetic medium, CD-ROM, any other optical medium, punch cards, papertape, any other physical medium with patterns of holes, RAM, PROM,EPROM, FLASH-EPROM, any other memory chip or cartridge, or any othermedium from which a computer can read.

In an embodiment of the disclosure, execution of the sequences ofinstructions to practice the disclosure is performed by a singlecomputer system 700. According to other embodiments of the disclosure,two or more computer systems 700 coupled by communication link 710(e.g., LAN, PTSN, or wireless network) may perform the sequence ofinstructions required to practice the disclosure in coordination withone another.

Computer system 700 may transmit and receive messages, data, andinstructions, including program, e.g., application code, throughcommunication link 715 and communication interface 714. Received programcode may be executed by processor 707 as it is received, and/or storedin disk drive 710, or other non-volatile storage for later execution. Adatabase 732 in a storage medium 731 may be used to store dataaccessible by the system 700 via data interface 733.

FIG. 8 illustrates a simplified block diagram of one or more componentsof a system environment 800 by which more efficient access to orderedsequences in a clustered database environment is provided, in accordancewith an embodiment of the present disclosure. In the illustratedembodiment, system environment 800 includes one or more client computingdevices 804, 806, and 808 that may be used by users to interact with acloud infrastructure system 802 that provides cloud services. The clientcomputing devices may be configured to operate a client application suchas a web browser, a proprietary client application, or some otherapplication, which may be used by a user of the client computing deviceto interact with cloud infrastructure system 802 to use servicesprovided by cloud infrastructure system 802.

It should be appreciated that cloud infrastructure system 802 depictedin the figure may have other components than those depicted. Further,the embodiment shown in the figure is only one example of a cloudinfrastructure system that may incorporate an embodiment of thedisclosure. In some other embodiments, cloud infrastructure system 802may have more or fewer components than shown in the figure, may combinetwo or more components, or may have a different configuration orarrangement of components. Client computing devices 804, 806, and 808may be devices similar to those described above for FIG. 7 . Althoughsystem environment 800 is shown with three client computing devices, anynumber of client computing devices may be supported. Other devices suchas devices with sensors, etc. may interact with cloud infrastructuresystem 802.

Network(s) 810 may facilitate communications and exchange of databetween client computing devices 804, 806, and 808 and cloudinfrastructure system 802. Each network may be any type of networkfamiliar to those skilled in the art that can support datacommunications using any of a variety of commercially-availableprotocols. Cloud infrastructure system 802 may comprise one or morecomputers and/or servers.

In certain embodiments, services provided by the cloud infrastructuresystem may include a host of services that are made available to usersof the cloud infrastructure system on demand, such as online datastorage and backup solutions, Web-based e-mail services, hosted officesuites and document collaboration services, database processing, managedtechnical support services, and the like. Services provided by the cloudinfrastructure system can dynamically scale to meet the needs of itsusers. A specific instantiation of a service provided by cloudinfrastructure system is referred to herein as a “service instance.” Ingeneral, any service made available to a user via a communicationnetwork, such as the Internet, from a cloud service provider's system isreferred to as a “cloud service.” Typically, in a public cloudenvironment, servers and systems that make up the cloud serviceprovider's system are different from the customer's own on-premisesservers and systems. For example, a cloud service provider's system mayhost an application, and a user may, via a communication network such asthe Internet, on demand, order and use the application.

In some examples, a service in a computer network cloud infrastructuremay include protected computer network access to storage, a hosteddatabase, a hosted web server, a software application, or other serviceprovided by a cloud vendor to a user, or as otherwise known in the art.For example, a service can include password-protected access to remotestorage on the cloud through the Internet. As another example, a servicecan include a web service-based hosted relational database and ascript-language middleware engine for private use by a networkeddeveloper. As another example, a service can include access to an emailsoftware application hosted on a cloud vendor's web site.

In certain embodiments, cloud infrastructure system 802 may include asuite of applications, middleware, and database service offerings thatare delivered to a customer in a self-service, subscription-based,elastically scalable, reliable, highly available, and secure manner.

In various embodiments, cloud infrastructure system 802 may be adaptedto automatically provision, manage and track a customer's subscriptionto services offered by cloud infrastructure system 802. Cloudinfrastructure system 802 may provide the cloud services via differentdeployment models. For example, services may be provided under a publiccloud model in which cloud infrastructure system 802 is owned by anorganization selling cloud services and the services are made availableto the general public or different industry enterprises. As anotherexample, services may be provided under a private cloud model in whichcloud infrastructure system 802 is operated solely for a singleorganization and may provide services for one or more entities withinthe organization. The cloud services may also be provided under acommunity cloud model in which cloud infrastructure system 802 and theservices provided by cloud infrastructure system 802 are shared byseveral organizations in a related community. The cloud services mayalso be provided under a hybrid cloud model, which is a combination oftwo or more different models.

In some embodiments, the services provided by cloud infrastructuresystem 802 may include one or more services provided under Software as aService (SaaS) category, Platform as a Service (PaaS) category,Infrastructure as a Service (IaaS) category, or other categories ofservices including hybrid services. A customer, via a subscriptionorder, may order one or more services provided by cloud infrastructuresystem 802. Cloud infrastructure system 802 then performs processing toprovide the services in the customer's subscription order.

In some embodiments, the services provided by cloud infrastructuresystem 802 may include, without limitation, application services,platform services and infrastructure services. In some examples,application services may be provided by the cloud infrastructure systemvia a SaaS platform. The SaaS platform may be configured to providecloud services that fall under the SaaS category. For example, the SaaSplatform may provide capabilities to build and deliver a suite ofon-demand applications on an integrated development and deploymentplatform. The SaaS platform may manage and control the underlyingsoftware and infrastructure for providing the SaaS services. Byutilizing the services provided by the SaaS platform, customers canutilize applications executing on the cloud infrastructure system.Customers can acquire the application services without the need forcustomers to purchase separate licenses and support. Various differentSaaS services may be provided. Examples include, without limitation,services that provide solutions for sales performance management,enterprise integration, and business flexibility for largeorganizations.

In some embodiments, platform services may be provided by the cloudinfrastructure system via a PaaS platform. The PaaS platform may beconfigured to provide cloud services that fall under the PaaS category.Examples of platform services may include without limitation servicesthat allow organizations to consolidate existing applications on ashared, common architecture, as well as the ability to build newapplications that leverage the shared services provided by the platform.The PaaS platform may manage and control the underlying software andinfrastructure for providing the PaaS services. Customers can acquirethe PaaS services provided by the cloud infrastructure system withoutthe need for customers to purchase separate licenses and support.

By utilizing the services provided by the PaaS platform, customers canemploy programming languages and tools supported by the cloudinfrastructure system and also control the deployed services. In someembodiments, platform services provided by the cloud infrastructuresystem may include database cloud services, middleware cloud services,and Java cloud services. In one embodiment, database cloud services maysupport shared service deployment models that allow organizations topool database resources and offer customers a Database as a Service inthe form of a database cloud. Middleware cloud services may provide aplatform for customers to develop and deploy various businessapplications, and Java cloud services may provide a platform forcustomers to deploy Java applications, in the cloud infrastructuresystem.

Various different infrastructure services may be provided by an IaaSplatform in the cloud infrastructure system. The infrastructure servicesfacilitate the management and control of the underlying computingresources, such as storage, networks, and other fundamental computingresources for customers utilizing services provided by the SaaS platformand the PaaS platform.

In certain embodiments, cloud infrastructure system 802 may also includeinfrastructure resources 830 for providing the resources used to providevarious services to customers of the cloud infrastructure system. In oneembodiment, infrastructure resources 830 may include pre-integrated andoptimized combinations of hardware, such as servers, storage, andnetworking resources to execute the services provided by the PaaSplatform and the SaaS platform.

In some embodiments, resources in cloud infrastructure system 802 may beshared by multiple users and dynamically re-allocated per demand.Additionally, resources may be allocated to users in different timezones. For example, cloud infrastructure system 830 may allow a firstset of users in a first time zone to utilize resources of the cloudinfrastructure system for a specified number of hours and then allow there-allocation of the same resources to another set of users located in adifferent time zone, thereby maximizing the utilization of resources.

In certain embodiments, a number of internal shared services 832 may beprovided that are shared by different components or modules of cloudinfrastructure system 802 and by the services provided by cloudinfrastructure system 802. These internal shared services may include,without limitation, a security and identity service, an integrationservice, an enterprise repository service, an enterprise managerservice, a virus scanning and white list service, a high availability,backup and recovery service, service for enabling cloud support, anemail service, a notification service, a file transfer service, and thelike.

In certain embodiments, cloud infrastructure system 802 may providecomprehensive management of cloud services (e.g., SaaS, PaaS, and IaaSservices) in the cloud infrastructure system. In one embodiment, cloudmanagement functionality may include capabilities for provisioning,managing and tracking a customer's subscription received by cloudinfrastructure system 802, and the like.

In one embodiment, as depicted in the figure, cloud managementfunctionality may be provided by one or more modules, such as an ordermanagement module 820, an order orchestration module 822, an orderprovisioning module 824, an order management and monitoring module 826,and an identity management module 828. These modules may include or beprovided using one or more computers and/or servers, which may begeneral purpose computers, specialized server computers, server farms,server clusters, or any other appropriate arrangement and/orcombination.

In operation 834, a customer using a client device, such as clientcomputing devices 804, 806 or 808, may interact with cloudinfrastructure system 802 by requesting one or more services provided bycloud infrastructure system 802 and placing an order for a subscriptionfor one or more services offered by cloud infrastructure system 802. Incertain embodiments, the customer may access a cloud User Interface(UI), cloud UI 812, cloud UI 814 and/or cloud UI 816 and place asubscription order via these UIs. The order information received bycloud infrastructure system 802 in response to the customer placing anorder may include information identifying the customer and one or moreservices offered by the cloud infrastructure system 802 that thecustomer intends to subscribe to.

After an order has been placed by the customer, the order information isreceived via the cloud UIs, 812, 814 and/or 816. At operation 836, theorder is stored in order database 818. Order database 818 can be one ofseveral databases operated by cloud infrastructure system 802 andoperated in conjunction with other system elements. At operation 838,the order information is forwarded to an order management module 820. Insome instances, order management module 820 may be configured to performbilling and accounting functions related to the order, such as verifyingthe order, and upon verification, booking the order. At operation 840,information regarding the order is communicated to an orderorchestration module 822. Order orchestration module 822 may utilize theorder information to orchestrate the provisioning of services andresources for the order placed by the customer. In some instances, orderorchestration module 822 may orchestrate the provisioning of resourcesto support the subscribed services using the services of orderprovisioning module 824.

In certain embodiments, order orchestration module 822 allows themanagement of business processes associated with each order and appliesbusiness logic to determine whether an order should proceed toprovisioning. At operation 842, upon receiving an order for a newsubscription, order orchestration module 822 sends a request to orderprovisioning module 824 to allocate resources and configure thoseresources needed to fulfill the subscription order. Order provisioningmodule 824 allows the allocation of resources for the services orderedby the customer. Order provisioning module 824 provides a level ofabstraction between the cloud services provided by cloud infrastructuresystem 802 and the physical implementation layer that is used toprovision the resources for providing the requested services. Orderorchestration module 822 may thus be isolated from implementationdetails, such as whether or not services and resources are actuallyprovisioned on the fly or pre-provisioned and only allocated/assignedupon request.

At operation 844, once the services and resources are provisioned, anotification of the provided service may be sent to customers on clientcomputing devices 804, 806 and/or 808 by order provisioning module 824of cloud infrastructure system 802.

At operation 846, the customer's subscription order may be managed andtracked by an order management and monitoring module 826. In someinstances, order management and monitoring module 826 may be configuredto collect usage statistics for the services in the subscription order,such as the amount of storage used, the amount data transferred, thenumber of users, and the amount of system up time and system down time.

In certain embodiments, cloud infrastructure system 802 may include anidentity management module 828. Identity management module 828 may beconfigured to provide identity services, such as access management andauthorization services in cloud infrastructure system 802. In someembodiments, identity management module 828 may control informationabout customers who wish to utilize the services provided by cloudinfrastructure system 802. Such information can include information thatauthenticates the identities of such customers and information thatdescribes which actions those customers are authorized to performrelative to various system resources (e.g., files, directories,applications, communication ports, memory segments, etc.) Identitymanagement module 828 may also include the management of descriptiveinformation about each customer and about how and by whom thatdescriptive information can be accessed and modified.

In the foregoing specification, the disclosure has been described withreference to specific embodiments thereof. It will, however, be evidentthat various modifications and changes may be made thereto withoutdeparting from the broader spirit and scope of the disclosure. Forexample, the above-described process flows are described with referenceto a particular ordering of process actions. However, the ordering ofmany of the described process actions may be changed without affectingthe scope or operation of the disclosure. The specification and drawingsare, accordingly, to be regarded in an illustrative rather thanrestrictive sense. In addition, an illustrated embodiment need not haveall the aspects or advantages shown. An aspect or an advantage describedin conjunction with a particular embodiment is not necessarily limitedto that embodiment and can be practiced in any other embodiments even ifnot so illustrated. Also, reference throughout this specification to“some embodiments” or “other embodiments” means that a particularfeature, structure, material, or characteristic described in connectionwith the embodiments is included in at least one embodiment. Thus, theappearances of the phrase “in some embodiment” or “in other embodiments”in various places throughout this specification are not necessarilyreferring to the same embodiment or embodiments.

What is claimed is:
 1. A method, comprising: identifying a cached listof sequence numbers; receiving a request for a set of sequence numbersin a database environment; and adaptively provisioning the set ofsequence numbers to fulfill the request, wherein the set of sequencenumbers is adaptively provisioned to dynamically identify a number ofvalues to include in the set of sequence numbers.
 2. The method of claim1, wherein adaptively provisioning the one or more sequence numbers tofulfill the request is based at least in part upon an independent cacheimplementation comprising: determining whether the cached list ofsequence numbers has been fully consumed; and when it is determined thatthe cached list of sequence numbers has been fully consumed, adaptivelydetermining a new list of sequence numbers based at least in part uponone or more criteria, wherein the one or more criteria comprise at leastone of a consumption rate for sequence numbers, a consumption timeperiod, a total number of sequence numbers in the cached list ofsequence numbers, or a high-watermark associated with the sequencenumbers in the database environment.
 3. The method of claim 1, whereinadaptively provisioning the one or more sequence numbers to fulfill therequest is based at least in part upon an independent cacheimplementation, wherein a first instance or node corresponds to a firstcache of sequence numbers and a second instance or node corresponds to asecond cache of sequence numbers, and the first cache of sequencenumbers does not overlap with the second cache of sequence numbers. 4.The method of claim 1, wherein adaptively provisioning the one or moresequence numbers to fulfill the request based at least in part upon ashared cache implementation, wherein a first instance or nodecorresponds to a first cache of sequence numbers and a second instanceor node corresponds to a second cache of sequence numbers, and the firstcache of sequence numbers overlaps with the second cache of sequencenumbers.
 5. The method of claim 1, wherein adaptively provisioning theone or more sequence numbers to fulfill the request based at least inpart upon a shared cache implementation comprises: identifying orreceiving the request for one or more sequence numbers; updating, at arequesting entity of the request, the cached list of sequence numberswith adaptively generated sequence numbers; and updating, at therequesting entity of the request, a high-watermark and a next availablesequence number based at least in part upon the adaptively generatedsequence numbers.
 6. The method of claim 5, wherein adaptivelyprovisioning the one or more sequence numbers to fulfill the requestbased at least in part upon the shared cache implementation furthercomprises: receiving a separate request for one or more separatesequence numbers from a separate requesting entity; and updating, at theseparate requesting entity, a separate cached list of sequence numbersinto an updated separate cached list of sequence numbers based at leastin part upon the high-watermark and the next available sequence number.7. The method of claim 6, wherein adaptively provisioning the one ormore sequence numbers to fulfill the request based at least in part uponthe shared cache implementation further comprises: when it is determinedthat the updated separate cached list of sequence numbers has been fullyconsumed, performing a set of acts that comprises: identifying aseparate request for one or more separate sequence numbers; updating,for a separate requesting entity, the updated separate cached list ofsequence numbers into a next cached list of sequence numbers with newadaptively generated sequence numbers; and consuming, at the separaterequesting entity, the next cached list of sequence numbers.
 8. A systemcomprising: a processor; and a memory to hold a set of program codeinstructions, in which the set of program code instructions comprisesprogram code to perform a set of acts, the set of acts comprising:identifying a cached list of sequence numbers; receiving a request for aset of sequence numbers in a database environment; and adaptivelyprovisioning the set of sequence numbers to fulfill the request, whereinthe set of sequence numbers is adaptively provisioned to dynamicallyidentify a number of values to include in the set of sequence numbers.9. The system of claim 8, wherein adaptively provisioning the one ormore sequence numbers to fulfill the request is based at least in partupon an independent cache implementation, the set of acts furthercomprising: determining whether the cached list of sequence numbers hasbeen fully consumed; and when it is determined that the cached list ofsequence numbers has been fully consumed, adaptively determining a newlist of sequence numbers based at least in part upon one or morecriteria, wherein the one or more criteria comprise at least one of aconsumption rate for sequence numbers, a consumption time period, atotal number of sequence numbers in the cached list of sequence numbers,or a high-watermark associated with the sequence numbers in the databaseenvironment.
 10. The system of claim 8, wherein adaptively provisioningthe one or more sequence numbers to fulfill the request is based atleast in part upon an independent cache implementation, wherein a firstinstance or node corresponds to a first cache of sequence numbers and asecond instance or node corresponds to a second cache of sequencenumbers, and the first cache of sequence numbers does not overlap withthe second cache of sequence numbers.
 11. The system of claim 8, whereinadaptively provisioning the one or more sequence numbers to fulfill therequest based at least in part upon a shared cache implementation,wherein a first instance or node corresponds to a first cache ofsequence numbers and a second instance or node corresponds to a secondcache of sequence numbers, and the first cache of sequence numbersoverlaps with the second cache of sequence numbers.
 12. The system ofclaim 8, wherein adaptively provisioning the one or more sequencenumbers to fulfill the request is based at least in part upon a sharedcache implementation, the set of acts further comprising: identifying orreceiving the request for one or more sequence numbers; updating, at arequesting entity of the request, the cached list of sequence numberswith adaptively generated sequence numbers; and updating, at therequesting entity of the request, a high-watermark and a next availablesequence number based at least in part upon the adaptively generatedsequence numbers.
 13. The system of claim 12, the set of acts furthercomprising: receiving a separate request for one or more separatesequence numbers from a separate requesting entity; and updating, at theseparate requesting entity, a separate cached list of sequence numbersinto a separate updated cached list of sequence numbers based at leastin part upon the high-watermark and the next available sequence number.14. The system of claim 13, the set of acts further comprising: when itis determined that the updated separate cached list of sequence numbershas been fully consumed, performing a set of acts that comprises:identifying a separate request for one or more separate sequencenumbers; updating, for a separate requesting entity, the updatedseparate cached list of sequence numbers into a next cached list ofsequence numbers with new adaptively generated sequence numbers; andconsuming, at the separate requesting entity, the next cached list ofsequence numbers.
 15. A computer program product including anon-transitory computer readable medium having stored thereuponinstructions which, when executed by a processor, causes the processorto perform a set of acts, the set of acts comprising: identifying acached list of sequence numbers; receiving a request for a set ofsequence numbers in a database environment; and adaptively provisioningthe set of sequence numbers to fulfill the request, wherein the set ofsequence numbers is adaptively provisioned to dynamically identify anumber of values to include in the set of sequence numbers.
 16. Thecomputer program product of claim 15, wherein adaptively provisioningthe one or more sequence numbers to fulfill the request is based atleast in part upon an independent cache implementation, the set of actsfurther comprising: determining whether the cached list of sequencenumbers has been fully consumed; and when it is determined that thecached list of sequence numbers has been fully consumed, adaptivelydetermining a new list of sequence numbers based at least in part uponone or more criteria, wherein the one or more criteria comprise at leastone of a consumption rate for sequence numbers, a consumption timeperiod, a total number of sequence numbers in the cached list ofsequence numbers, or a high-watermark associated with the sequencenumbers in the database environment.
 17. The computer program product ofclaim 15, wherein adaptively provisioning the one or more sequencenumbers to fulfill the request is based at least in part upon anindependent cache implementation, wherein a first instance or nodecorresponds to a first cache of sequence numbers and a second instanceor node corresponds to a second cache of sequence numbers, and the firstcache of sequence numbers does not overlap with the second cache ofsequence numbers.
 18. The computer program product of claim 15, whereinadaptively provisioning the one or more sequence numbers to fulfill therequest based at least in part upon a shared cache implementation,wherein a first instance or node corresponds to a first cache ofsequence numbers and a second instance or node corresponds to a secondcache of sequence numbers, and the first cache of sequence numbersoverlaps with the second cache of sequence numbers.
 19. The computerprogram product of claim 15, wherein adaptively provisioning the one ormore sequence numbers to fulfill the request based at least in part upona shared cache implementation, the set of acts further comprising:identifying or receiving the request for one or more sequence numbers;updating, at a requesting entity of the request, the cached list ofsequence numbers with adaptively generated sequence numbers; andupdating, at the requesting entity of the request, a high-watermark anda next available sequence number based at least in part upon theadaptively generated sequence numbers.
 20. The computer program productof claim 19, the set of acts further comprising: receiving a separaterequest for one or more separate sequence numbers from a separaterequesting entity; and updating, at the separate requesting entity, aseparate cached list of sequence numbers into a separate updated cachedlist of sequence numbers based at least in part upon the high-watermarkand the next available sequence number.
 21. The computer program productof claim 20, the set of acts further comprising: when it is determinedthat the updated separate cached list of sequence numbers has been fullyconsumed, performing a set of acts that comprises: identifying aseparate request for one or more separate sequence numbers; updating,for a separate requesting entity, the updated separate cached list ofsequence numbers into a next cached list of sequence numbers with newadaptively generated sequence numbers; and consuming, at the separaterequesting entity, the next cached list of sequence numbers.